package com.treasure.web.mapstruct;

import com.treasure.infrastructure.model.po.CorpInfo;
import com.treasure.web.command.response.CorpInfoResponse;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author sunhongmin
 * @date 2023/11/5 20:04
 * @description
 */
@Mapper
public interface CorpInfoAssembler {
    CorpInfoAssembler INSTANCE = Mappers.getMapper(CorpInfoAssembler.class);

    @Mapping(source = "userLimit", target = "userCount")
    @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    CorpInfoResponse toCorpInfoResponse(CorpInfo corpInfo);

    List<CorpInfoResponse> toCorpInfoResponse(List<CorpInfo> corpInfoList);
}
